package com.fr.funglisoftproduction.flanders;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainMenu extends Activity implements OnClickListener {
	private Intent toLive, toNews, toAgenda, toDedicaces, toVideos;
	private Button live, news, agenda, dedicaces, videos;
	
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
    	// Comportement de base
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main_menu);
        
        // Initialisation des variables d'instance
        toLive = new Intent(this, Live.class);
        toNews = new Intent(this, News.class);
        toAgenda = new Intent(this, Agenda.class);
        toDedicaces = new Intent(this, Dedicaces.class);
        toVideos = new Intent(this, Videos.class);
        
        live = (Button)findViewById(R.id.live);
        news = (Button)findViewById(R.id.news);
        agenda = (Button)findViewById(R.id.agenda);
        dedicaces = (Button)findViewById(R.id.dedicaces);
        videos = (Button)findViewById(R.id.videos);
        
        live.setOnClickListener(this);
        news.setOnClickListener(this);
        agenda.setOnClickListener(this);
        dedicaces.setOnClickListener(this);
        videos.setOnClickListener(this);
    }


	public void onClick(View v) {
		if (v instanceof Button)
		{
			Button b = (Button)v;
			
			if (b == live)
				startActivity(toLive);
			else if (b == news)
				startActivity(toNews);
			else if (b == agenda)
				startActivity(toAgenda);
			else if (b == dedicaces)
				startActivity(toDedicaces);
			else if (b == videos)
				startActivity(toVideos);
		}
	}
}